# New ports collection makefile for:	apiextractor
# Date created:		18 March 2011
# Whom:			jashank/tigersharke
#
# $FreeBSD$
#

PORTNAME=	apiextractor
DISTVERSION=	0.10.8
CATEGORIES=	x11-toolkits python
MASTER_SITES=	http://www.pyside.org/files/

MAINTAINER=	jashankj@pondr.net
COMMENT=	API extractor for PySide

BUILD_DEPENDS+=	${LOCALBASE}/bin/sphinx-build:${PORTSDIR}/textproc/py-sphinx

USE_BZIP2=	yes
USE_CMAKE=	yes
USE_DOS2UNIX=	yes
#CMAKE_OUTSOURCE=yes
CMAKE_VERBOSE=	yes

CMAKE_ARGS+=	-DQT_SRC_DIR=${PORTSDIR}/devel/qt4

USE_QT_VER=	4
QT_COMPONENTS=	accessible \
		clucene codecs-cn codecs-jp codecs-kr codecs-tw corelib \
		dbus declarative designer \
		graphicssystems-opengl gui help \
		iconengines imageformats \
		multimedia network opengl \
		phonon \
		qt3support qtestlib \
		script scripttools sql sql-mysql \
		sql-odbc sql-pgsql sql-sqlite2 svg \
		webkit xml xmlpatterns

# USE_GNOME=	libxml2 libxslt glib20
# USE_GMAKE=	yes
USE_GL=		glu glw glew gl linux
USE_LDCONFIG=	yes

OPTIONS=	WITHOUT_NLS "Enable support for Gettext" On \
		DISABLE_DOCSTRINGS "Disable documentation extraction." Off \
		BUILD_TESTS "Build tests." On \
		INSTALL_TESTS "Install tests" Off \
		ENABLE_VERSION_SUFFIX "Allow multiples versions" Off \
		ENABLE_GCC_OPTIMIZATION "Library size and performance" Off

.include <bsd.port.options.mk>

.if !defined(WITHOUT_NLS)
USE_GETTEXT=	yes
USE_ICONV=	yes
PLIST_SUB+=	NLS=""
.else
CONFIGURE_ARGS+=--disable-nls
PLIST_SUB+=	NLS="@comment "
.endif

.if defined(DISABLE_DOCSTRINGS)
DISABLE_DOCSTRINGS=TRUE
.else
DISABLE_DOCSTRINGS=FALSE
.endif

.if defined(BUILD_TESTS)
BUILD_TESTS=	TRUE
.else
BUILD_TESTS=	FALSE
.endif

.if defined(INSTALL_TESTS)
INSTALL_TESTS=	TRUE
.else
INSTALL_TESTS=	FALSE
.endif

.if defined(ENABLE_VERSION_SUFFIX)
ENABLE_VERSION_SUFFIX=TRUE
.else
ENABLE_VERSION_SUFFIX=FALSE
.endif

.if defined(ENABLE_GCC_OPTIMIZATION)
ENABLE_GCC_OPTIMIZATION=TRUE
.else
ENABLE_GCC_OPTIMIZATION=FALSE
.endif

post-extract:
##	${REINPLACE_CMD} 's|/pkgconfig|/libdata/pkgconfig|g' ${WRKSRC}/data/CMakeLists.txt
#	${REINPLACE_CMD} 's|/pkgconfig|${WRKSRC}|g' ${WRKSRC}/data/CMakeLists.txt
#	${REINPLACE_CMD} 's|LIB_INSTALL_DIR|ArthurDent|g' ${WRKSRC}/data/CMakeLists.txt
#	${REINPLACE_CMD} 's|/cmake/ApiExtractor-|${LOCALBASE}/share/cmake/Modules|g' ${WRKSRC}/data/CMakeLists.txt
#	${REINPLACE_CMD} 's|apiextractor_VERSION|ZaphodBeeblebrox|g' ${WRKSRC}/data/CMakeLists.txt
###	${REINPLACE_CMD} -e 's|$${LIB_INSTALL_DIR}/pkgconfig|data/pkgconfig|' ${WRKSRC}/data/CMakeLists.txt

.include <bsd.port.mk>
